package com.zishi.model.pojo;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;

import lombok.Data;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import lombok.experimental.Accessors;
import org.apache.ibatis.type.Alias;

/**
 * <p>
 * 用户点赞和收藏的文章表
 * </p>
 *
 * @author TP
 * @since 2022-05-05 08:53:41
 */
@Data
@Accessors(chain = true)
@TableName("user_article_ref")
@NoArgsConstructor
@Alias("UserArticleRef")
public class UserArticleRef implements Serializable {

    private static final long serialVersionUID = 1L;

    /**
     * 主键id
     */
    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;

    /**
     * user表主键id
     */
    @TableField("user_id")
    private Integer userId;

    /**
     * article表主键id
     */
    @TableField("article_id")
    private Integer articleId;

    /**
     * 1为用户已点赞,0为未点赞
     */
    @TableField("liked")
    private Integer liked;

    /**
     * 1为用户已收藏,0为未收藏
     */
    @TableField("collected")
    private Integer collected;

    public UserArticleRef(Integer userId, Integer articleId, Integer liked, Integer collected) {
        this.userId = userId;
        this.articleId = articleId;
        this.liked = liked;
        this.collected = collected;
    }
}
